define(['app'], function(app) {
    'use strict';
    //实例化方法
    var factory = function (Http) {
        /**
         * 一键切换数据获取方式
         * @param {Object} result
         */
        function get_data_getexhibitionlist(result) {
            if (false) {
                result = '{"success": true, "msg": "", "result": {"id": "001", "name": "五金展会", "issue_time": "2017/01/01 09:00:00", "exhibition_time": "2017/03/01 09:00:00", "exhibition_site": "上海", "url": "","create_name":"上海五金公司", "data": [{"image_id": "001", "image": "img/purchaseNow1.png", "article": "展会介绍文章"}, {"image_id": "002", "image": "img/purchaseNow1.png", "article": "展会介绍文章"}]}, "session": "7311da98bd0f18eb15a96bcb263f4153"}';
                return JSON.parse(result);
            }
            else {
                return result;
            }
        }
        
        //返回信息
        return {
            //行业展会详细信息
            getlist: function(id,callback) {
                Http.post({
                    method: 'info.exhibition.detail', 
                    id:id
                }, function (result) {
                    //请求成功
                    if (callback) {
                        callback(get_data_getexhibitionlist(result).result);
                    }
                }, function (e) {
                    //请求异常
                }, function () {
                    //请求完成，一般不做什么事情
				});
            }
			
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Showdetail", factory);
});